home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / xlog / filelog.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-25  |  1.2 KB  |  41 lines

  1. /*
  2.  * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  3.  * All rights reserved.  The file named COPYRIGHT specifies the terms 
  4.  * and conditions for redistribution.
  5.  */
  6.  
  7.  
  8. /*
  9.  * $Id: filelog.h,v 2.1 1993/05/06 07:39:39 panos Exp $
  10.  */
  11.  
  12. /*
  13.  * The file can be either open or closed.
  14.  * When the file is closed, the state is always FL_CLOSED.
  15.  * When the file is open, the state is:
  16.  *        FL_OPEN:            if everything is ok
  17.  *        FL_SIZE:            if the hard limit was exceeded
  18.  *        FL_ERROR:        if an error occured
  19.  */
  20. typedef enum { FL_CLOSED = 0, FL_OPEN, FL_SIZE, FL_ERROR } filelog_state_e ;
  21.  
  22. struct filelog
  23. {
  24.     int                    fl_fd ;
  25.     filelog_state_e    fl_state ;
  26.     bool_int             fl_close_on_exec ;
  27.     int                     fl_error ;                /* error code when in FL_ERROR        */
  28.     bool_int                fl_size_control ;        /* enabled or not                            */
  29.     bool_int                fl_issued_warning ;    /* when the soft limit was exceeded    */
  30.     unsigned             fl_size ;            /* current size                       */
  31.     unsigned                fl_soft_limit ;
  32.     unsigned                fl_hard_limit ;
  33. } ;
  34.  
  35. #define FILELOG_ENABLE_SIZE_CONTROL( flp )        (flp)->fl_size_control = TRUE
  36. #define FILELOG_DISABLE_SIZE_CONTROL( flp )        (flp)->fl_size_control = FALSE
  37. #define FILELOG_SIZE_CONTROL( flp )                ( (flp)->fl_size_control )
  38.  
  39. #define FILELOG( xp )            ((struct filelog *)xp->xl_data)
  40.  
  41.